<?php
namespace Admin\Controller;
use Admin\Controller\AdminBaseController;
use Admin\Model\SysMenuModel;
use Common\Model\BonusLogModel;
use Common\Model\BonusTypeModel;
/**
 * 后台首页控制器
 */
class IndexController extends AdminBaseController{
	/**
	 * 首页
	 */
	public function index(){
		$nav_data=SysMenuModel::newSelf()->getTreeData('level','order_number,id');
		$assign=array('data'=>$nav_data);
		$this->assign($assign);
		$this->display();
	}
	public function welcome()
	{
	    $bonus_model=BonusLogModel::newSelf();
	    $bonus_type=BonusTypeModel::newSelf()->getInfo();
	    foreach ($bonus_type as $k=>$v)
	    {
	        $data[$v['id']]= $bonus_model->where()->sum('bonus'.$v['id']);
	    }
	    $this->assign('data',$data);
	    $this->assign('bonus_type',$bonus_type);
	    $this->display();
	}
}
